Repository navigation
feat(viewer): design tokens (radius, type, spacing, colour, hairlines, motion) - #269
Open
NickAltstein wants to merge 3 commits into
Open
NickAltstein wants to merge 3 commits into
NickAltstein wants to merge 3 commits into
Conversation
…nes and motion Adds viewer/tokens.css (loaded first on every page that uses the shared stylesheets) and scripts/css_tokens_codemod.py, which moves literal values in the viewer stylesheets onto the tokens. The codemod is idempotent and has a --check mode. - radius: 2 / 4 / 8 / full (rendered home page: 12 radii -> 4, plus 50% circles) - type: 7 steps 11-36px, nothing under 11px; tabular-nums on body (rendered home page: 19 sizes -> 7 token steps + 2 clamp() display headings) - spacing: padding/margin/gap snapped to a 4px grid (1-3px nudges kept) - colour: graphite surfaces at 3 steps, one accent, muted metadata; the existing --ps-* variables now alias the tokens (same values) - hairlines: 1px rgba(255,255,255,0.06) - motion: 150/200ms ease-out; global prefers-reduced-motion rule Also adds scripts/visual/redesign-gates.mjs, an evidence harness: 5 scenarios x 5 widths, overflow / bottom-bar / one-line price / number-once assertions, optional axe scan, on data pinned to scripts/visual/redesign-data-ref. Presentation only: no model, pricing, gate or copy change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The token codemod changed viewer/ufc.css and bumped its ?v= to 2026_v201 in index.html and sw.js, but viewer/ufc/fighter.html still loaded 2026_v199, so returning visitors would get the old stylesheet there and check_cache_busters.py failed CI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tifacts New workflow .github/workflows/viewer-gates.yml (pull requests touching viewer/ or scripts/visual/): captures the base branch and this PR with scripts/visual/redesign-gates.mjs on the same pinned data, uploads both sets, the pixel diffs and the reports as a workflow artifact, and fails only on a regression vs the base branch (new --baseline mode): an assertion that passes on base but fails here, or a new serious/critical axe rule. Failures base already has are reported, not enforced. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR 2 of 6 in the viewer redesign. Design tokens only, with no intended change to the design. Branched from
main@b99b71e88and independent of PR 1.What changed
viewer/tokens.css(new) is loaded first on every page that uses the shared stylesheets:index,ledger,audit,verify,ledger/,r/,t/,check/,ufc/fighter.--r-12px ·--r-24px ·--r-38px ·--r-full--fs-1…--fs-7= 11 / 12 / 14 / 16 / 20 / 28 / 36px. Nothing is under 11px.body { font-variant-numeric: tabular-nums }--sp-1…--sp-12on a 4px grid--c-surface-0/1/2,--c-text,--c-text-muted,--c-text-faint, and one--c-accent. The existing--ps-*variables now alias these at the same values.--hairline: 1px solid rgba(255,255,255,0.06)--dur-1150ms,--dur-2200ms,--ease-out, and a globalprefers-reduced-motionrulescripts/css_tokens_codemod.py(new) moves the literal values instyle.css,terminal-ui.css,refresh-2026.css,design-system.cssandufc.cssonto the tokens. It is idempotent, and--checkexits 1 if a literal is left.--radius*,--rf-r*,--ps-radius) now point at the tokens.scripts/visual/redesign-gates.mjs(new) is the evidence harness for this series.scripts/visual/redesign-data-ref. The file is byte-identical in PR 1.CACHE_NAMEchanged, andpublic/was mirrored.Measured effect (rendered home page, 390 + 1440, all
<details>open)clamp()headings (22, 26px)Because spacing and small text moved onto the grid, the pixel diff is large: 28–35% of the home page changes at mobile widths. Elements below shift down a few pixels. The design itself is unchanged; compare side by side below.
Before / after
390 home (left =

main, right = this PR)390 no-quote cards

1440 home

All 25 after-screenshots (5 scenarios × 5 widths) and the gate report are in
evidence/viewer-redesign/pr2.Tests and gates
→
tests 217 · pass 217 · fail 0. Browser tests ran (Chrome found).→
822 passed, 3 skipped.venv/bin/python scripts/check_public_sync.py && python3 scripts/css_tokens_codemod.py --check→
public/ matches viewer/ and contains no win-rate/ROI copy.·would change: nothingSame results as
mainon every assertion; this PR fixes no layout bugs (that is PR 3/4):button-name(critical,#headerSearchTrigger) andnested-interactive(serious, list cards). Both are also onmain; PR 3/5 fix them. Nocolor-contrastviolations.Lighthouse mobile (3 runs, local
python3 -m http.server):mainNot met: Performance ≥90 and LCP <2.5s.
mainis far off too, and a token change can't close that gap. It needs separate work on the ~10k-lineapp.jsboot and the slate JSON loaded at startup. CLS meets the <0.05 target.Not done in this PR
--quote) alongside the green accent. Moving to one accent changes how quote states look, so it goes in PR 4 (player row).public.cssandverify-landing.css(verify/landing pages) were not migrated, and they use rem sizes.font-size/border-radiusin JS-templatestyle=""attributes were not migrated. Production CSP (style-src 'self') already blocks them.🤖 Generated with Claude Code